package com.ubst.smartad.impl.admin.system;

import java.sql.*;
import java.util.*;
import java.io.*;

import com.ubst.smartad.common.TimeUtil;
import com.ubst.smartad.logger.Debug;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

public class SystemMngImpl {
	
	Connection con = null;
	private String serverName;
	private Debug debug;
	//private FileHostEnv fhostEnv;


    /** 
     * 생성자
     *   
     *   
    */ 
	public SystemMngImpl(Connection con, String serverName, String log_level) {
		this.con = con;
		this.serverName = serverName;
		this.debug = new Debug("SystemMngImpl", log_level);
		//this.fhostEnv = FileHostEnv.getInstance(serverName);

	}

	
	/**
	 *  @author Kswany
	 * 	 System(시스템) - System jqGrid List 가져오기   
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridSystemList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("type", "Linux2");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux3");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux4");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux5");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("admin_account", "root");
			log_data_map.put("connect_way", "SSH");
			log_datas.add(log_data_map);
			
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	System(시스템) - System jqGrid Log List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridSystemLogList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("worker", "adminst");
			log_data_map.put("ip_addr", "192.068.1.206");
			log_data_map.put("type", "계정관리");
			log_data_map.put("work", "계정정책 변경");
			log_data_map.put("system_date", "2013-01-13 22:52:14");
			log_data_map.put("result", "실패");
			log_data_map.put("important", "정보");
			log_datas.add(log_data_map);
			
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * System(시스템) - System Info Log 가져오기 View
	 *	Primary key: system_name(가상설정)
	 */
	public HashMap getSystemInfo(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "어드민");
			log_info_map.put("system_id", "adadmin");
			log_info_map.put("system_kind", "Linux");
			log_info_map.put("os_version", "2.6");
			log_info_map.put("sid", "test01");
			log_info_map.put("ip_addr", "192.168.1.206");
			log_info_map.put("connect_way", "SSH");
			log_info_map.put("connect_port", "2212");
			log_info_map.put("data_req_res", "root");
			log_info_map.put("req_res_port", "레드햇 테스트 시스템");
			log_info_map.put("admin_account", "2013-04-29 오후 3:15:26");
			log_info_map.put("system_desc", "리눅스입니다");
			log_info_map.put("create_date", "2013-07-25 오후 5:55:48");
			
			
		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		return log_info_map;
	}
	
	/**
	 * @author : Kswany 
	 * System(시스템) - System Log 클릭시 Popup창으로 Info 가져오기
	 *	key: ip_addr(가상설정)
	 */
	public HashMap system_detail(String ip_addr) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("log_time", "2013-05-03 09:50:03");
			log_info_map.put("log_type", "계정관리");
			log_info_map.put("work_type", "계정정책 변경");
			log_info_map.put("user", "adadmin");
			log_info_map.put("account", "test1234");
			log_info_map.put("ip_addr", "192.168.1.1");
			log_info_map.put("target_system", "IDMServer");
			log_info_map.put("service", "webadmin");
			log_info_map.put("result", "실패");
			log_info_map.put("detail", "상세내역입니다");

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		
		return log_info_map;
	}
	
	
	/**
	 * @author : Kswany 
	 * System(시스템) - System 비밀번호 변경
	 *	key: pw(가상설정)
	 */
	public boolean updateSystemChangePw(String pw) 
	//	throws SQLException {
		throws Exception{
	
		PreparedStatement pstmt=null;
		ResultSet rs = null;
		
		boolean result = false;
		try {
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;
		
		}catch (Exception e){
			throw e;
		}finally{
		//	if ( rs != null) try{rs.close();}catch(SQLException ee){}
		//	if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	/**
	 * @author : Kswany 
	 * System(시스템) - System 보안 비밀번호 변경
	 *	key: pw(가상설정)
	 */
	public boolean updateSystemChangeSecurePw(String pw) 
	//	throws SQLException {
		throws Exception{
	
		PreparedStatement pstmt=null;
		ResultSet rs = null;
		
		boolean result = false;
		try {
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;
		
		}catch (Exception e){
			throw e;
		}finally{
		//	if ( rs != null) try{rs.close();}catch(SQLException ee){}
		//	if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	
	/**
	 * @author : Kswany 
	 * System(시스템) - System insert
	 *	key: system_name(가상설정)
	 */
	public boolean insertSystemAdd(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();
		boolean result = false;
		try {

			String system_name = String.valueOf(param.get("system_name"));
			String system_kind = String.valueOf(param.get("system_kind"));
			String ip_addr = String.valueOf(param.get("ip_addr"));
			String os_kind = String.valueOf(param.get("os_kind"));
			String os_version = String.valueOf(param.get("os_version"));
			String sid = String.valueOf(param.get("sid"));
			String connect_way = String.valueOf(param.get("connect_way"));
			String connect_port = String.valueOf(param.get("connect_port"));
			String data_req = String.valueOf(param.get("data_req"));
			String req_port = String.valueOf(param.get("req_port"));
			String manage_account = String.valueOf(param.get("manage_account"));
			String pw = String.valueOf(param.get("pw"));
			String pw_check = String.valueOf(param.get("pw_check"));
			String serverlock_pw = String.valueOf(param.get("serverlock_pw"));
			String serverlock_pw_check = String.valueOf(param.get("serverlock_pw_check"));
			String sys_ex = String.valueOf(param.get("sys_ex"));
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	/**
	 * @author : Kswany 
	 * System(시스템) - System delete(list checkbox선택후 삭제, 리스트 마지막으로 클릭 한 상세정보에서 삭제)
	 *	key: system_name(가상설정)
	 */
	public boolean deleteSystem(List array) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
	
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	/**
	 * @author : Kswany 
	 * System(시스템) - System insertSystemInfo
	 *	key: work_no(가상설정)
	 */
	public boolean insertSystemInfo(String work_no) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}



	/**
	 *  @author Kswany
	 * 	System(시스템) - user jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridUserList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			

		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자1");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자2");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자3");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자4");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자5");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("ip_addr", "192.068.1.201");
		log_data_map.put("admin_account", "root");
		log_data_map.put("connect_way", "SSH");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	System(시스템) - user jqGrid Log List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridUserLogList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			

		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * System(시스템) - user Log정보 가져오기 View
	 *	key: system_name(가상설정)
	 */
	public HashMap getUserInfo(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "어드민");
			log_info_map.put("system_id", "adadmin");
			log_info_map.put("system_kind", "Linux");
			log_info_map.put("os_version", "2.6");
			log_info_map.put("sid", "test01");
			log_info_map.put("ip_addr", "192.168.1.206");
			log_info_map.put("connect_way", "SSH");
			log_info_map.put("connect_port", "2212");
			log_info_map.put("data_req_res", "root");
			log_info_map.put("req_res_port", "레드햇 테스트 시스템");
			log_info_map.put("admin_account", "2013-04-29 오후 3:15:26");
			log_info_map.put("system_desc", "리눅스입니다");
			log_info_map.put("create_date", "2013-07-25 오후 5:55:48");
			
			
		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		return log_info_map;
	}


	
}
